/*
 * Package: org.grassfield.common.dao
 * FileName: TeamDAOTest.java
 *  
 * Created by pandian on Jan 28, 2011
 */
package dao;

import java.util.List;

import bean.Team;

import test.BaseTest;



/**
 * A junit test case for TeamDAO.
 */
public class TeamDAOTest extends BaseTest {
	private ITeamDAO teamDAO;
	

	/**
	 * Sets the team dao.
	 * 
	 * @param teamDAO the new team dao
	 */
	public void setTeamDAO(ITeamDAO teamDAO) {
		this.teamDAO = teamDAO;
	}

	/**
	 * Test case for find.
	 */
	public void testFind() {
		Long id = 1L;
		Team team = this.teamDAO.find(id);
		super.assertNotNull("team is null", team);
		super.assertTrue("id is not equal "+id+" "+team.getId(), team.getId().equals(id));
	}

	/**
	 * Test case for list.
	 */
	public void testList() {
		List<Team> list = this.teamDAO.list();
		super.assertNotNull("list is null",list);
		super.assertFalse("list is empty", list.isEmpty());
	}

}
